<{Tinclude "commom/admin_header"}>
 <section id="container" >
      
      <!--顶部-->
      <{Tinclude"commom/admin_inner_header"}>
      <!--顶部-->
      
       <{Tinclude"commom/admin_left_menu"}>
       
       <section id="main-content">
          <section class="wrapper">
          	<h3><i class="fa fa-list-ul"></i>菜单添加</h3>
                <div class="row mt">
                    <div class="col-md-12">
                       <div class="form-panel">  
                        
                        
                        
                        <form class="form" role="form" action="<{echo Common::RewriteUrl($jp_arg["c"],$jp_arg["a"]);}>"  method="post">     
<div class="form-group input-group col-md-6">
   
    <span class="input-group-addon" id="basic-addon1">菜单名称:</span>
    <input type="text" name="base_name" class="form-control" placeholder="名称" aria-describedby="basic-addon1">

</div>
   
 <div class="form-group  form-inline menuparent">
  <select class="form-control  parent_id" name="parent_id">
  
           <option value="0">顶级分类</option>
           <?php foreach($list as $val){?>
           <option value="<?php echo $val['id'];?>"><?php echo $val['name'];?></option>
          <?php }?>
      
         
  </select>

     
     
 </div>
         
         
         <div class="form-group input-group col-md-4">
   
    <span class="input-group-addon" id="basic-addon1">控制器名称:</span>
    <input type="text"  name="c" class="form-control" placeholder="控制器" aria-describedby="basic-addon1">

</div>
         
<div class="form-group input-group col-md-4">
   
    <span class="input-group-addon" id="basic-addon1">方法名称:</span>
    <input type="text" name="a" class="form-control" placeholder="方法" aria-describedby="basic-addon1">

</div>
<div class="form-group input-group col-md-4">
   
    <span class="input-group-addon" id="basic-addon1">图标样式:</span>
    <input type="text" name="iconclass" value="fa fa-desktop" class="form-control" placeholder="图标样式" aria-describedby="basic-addon1">

</div>
<div class="form-group input-group col-md-2">
   
    <span class="input-group-addon" id="basic-addon1">排序:</span>
    <input type="text" name="sort" class="form-control" placeholder="排序" aria-describedby="basic-addon1">

</div>
          
     <div class="form-group input-group col-md-4">     
     
<label class="radio-inline">
  <input type="radio" name="is_display" id="inlineRadio1" value="1"> 显示菜单
</label>
<label class="radio-inline">
  <input type="radio" name="is_display" id="inlineRadio2" value="0" checked> 不显示菜单
</label>
      </div>
          
          
           <div class="form-group input-group col-md-4">
            <input class="btn btn-default" type="submit" value="提交">
           </div>
  </form>
                        
                        
                        
                       </div>                
                        
                        
                        
                    </div>
                </div>
          </section>
       </section>
       
       
 </section>


<script>
    function menuselectchange(obj){
             var cid=$(obj).val();

             
         
             var thisobj=$(obj).parent();
                if(cid>0){
                  $(".menuchildren").attr("name","");
                  $(".parent_id").attr("name","");
                  $(obj).attr("name","parent_id");
              
                  $.post("<{echo Common::RewriteUrl("menu","public_get_children");}>",{"parent_id":cid},function(data){
                  $(".menuchildrenall").each(function(){
                      if($(this).index()>thisobj.index()){
                          $(this).remove();
                      }
                  });
                  text=data.replace(/(^\s*)|(\s*$)/g,'');
                  if(text.length>0){
                  $(".menuparent").append(data);
                  }
                 
      });
             }

        }
    $('.parent_id').bind('change', function () {
      var cid=$(this).val();
      var parent=$(this).parent();
      $(this).attr("name","parent_id");
      if(cid!=0){
      
      $.post("<{echo Common::RewriteUrl("menu","public_get_children");}>",{"parent_id":cid},function(data){
          $(".menuchildrenall").remove();
          parent.append(data);
         
      });
    }else{
      
        $(".menuchildrenall").remove();
    }
    });
    
    
    
</script>

<{Tinclude"commom/admin_footer"}>


